Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced repeat rules UI #8422

Open
wants to merge 14 commits into
base: dev-calendar
Choose a base branch
from

Conversation

Patrik-wav
Copy link
Contributor

closes #8047

@murilopereirame murilopereirame force-pushed the 8046-parse-advanced-repeat-rules branch 2 times, most recently from c8134f0 to 040498f Compare February 3, 2025 08:23
@tutao-mac tutao-mac force-pushed the 8046-parse-advanced-repeat-rules branch 2 times, most recently from 30a7bb4 to 7aefc39 Compare February 3, 2025 08:45
@murilopereirame murilopereirame force-pushed the 8046-parse-advanced-repeat-rules branch 2 times, most recently from ffbc61b to be4c63a Compare February 4, 2025 06:54
@tutao-mac tutao-mac force-pushed the 8046-parse-advanced-repeat-rules branch from be4c63a to e3da4ff Compare February 4, 2025 07:13
@murilopereirame murilopereirame force-pushed the 8046-parse-advanced-repeat-rules branch from a0e43a2 to 4ff0a1d Compare February 4, 2025 08:05
@tutao-mac tutao-mac force-pushed the 8046-parse-advanced-repeat-rules branch 3 times, most recently from cf65d58 to 7446664 Compare February 5, 2025 12:25
@murilopereirame murilopereirame force-pushed the 8046-parse-advanced-repeat-rules branch 10 times, most recently from d0e574b to 945ddb4 Compare February 12, 2025 15:10
Base automatically changed from 8046-parse-advanced-repeat-rules to dev-calendar February 13, 2025 04:19
Selecting the time frame for rules will now render day/week/month/year correctly
Introduce WeekdaySelectorButton component
Currently, reading BYDAY Rules from an existing event works, however writing them has not been added yet.
Upon closing the editor it now passes the values to the model
WeekRepetitionSelector component still needs to be finished and hooked up to the CalendarWhenModel
Fix undefined weekdays being written on AdvancedRules
When changing the date outside of the RepitionEditor, the advanced repeat rules would still use the old weekday. Now, when changing the date, it will also change the advanced repeat rules that have been configured
@Patrik-wav Patrik-wav force-pushed the 8047-advanced-repeat-rules-ui branch from cabb90a to 03f14a6 Compare February 13, 2025 06:43
const options: IntervalOption[] = [
{
value: 0,
ariaValue: "same day",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the translation as aria value so screen readers can announce the correct value for the options

const bydayRules = whenModel.advancedRules.filter((rule) => rule.ruleType == ByRule.BYDAY)
if (bydayRules.length == 1) {
const weekday: Weekday = Object.values(Weekday)[DateTime.fromJSDate(date).weekday - 1]
const regex = /^-?\d/g // Regex for extracting the first digit from interval
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if the user has imported an event with a ByDay rule with +2TH (RFC allows this).
Either we take care of this during import, or we adapt this regex to support the + sign

* we only specify what weekday of the month this event repeats on. (Ex.: BYDAY=2TH = Repeats on second THURSDAY of every month)
* In case weekdays.length() == 0 && interval == 0, no BYDAY Rule shall be written, as the event will repeat on the same DAY every month.
*/
private async createAdvancedRulesFromWeekdays(weekdays: Weekday[], interval?: number): Promise<AdvancedRepeatRule[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why async?

@@ -486,24 +486,122 @@ export const createCustomEndTypeOptions = (): ReadonlyArray<RadioGroupOption<End
]
}

export const createRepeatRuleEndTypeValues = (): SelectorItemList<EndType> => {
export const weekdayToTranslation = (): Array<WeekdayToTranslation> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can change it to an Array instead of a function. I'm not sure if it will break any rendering

options: this.repetitionOptions,
noIcon: false,
expanded: false,
tabIndex: Number(TabIndex.Programmatic),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This takes the select component out of the element three, making it unreachable through tabbing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants